import request from '/@/utils/requestcopy';
// 查询菜单列表
export function listCateMenu(query:any) {
    return request({
      url: '/system/lkCategory/menulist',
      method: 'get',
      params: query
    })
  }
// 查询菜单下拉树结构
export function treeselect() {
    return request({
      url: '/system/auth/getMenus',
      method: 'get'
    })
}
// 根据字典类型查询字典数据信息
export function getDicts(dictType:any,defaultValue:any) {
  defaultValue = defaultValue || ''
  let params ={
    dictType:dictType,
    defaultValue:defaultValue
  }
  return request({
    url: '/system/config/dict/data/GetDictData',
    method: 'get',
    params:params
  })
}

// 修改菜单
export function updateMenu(data:any) {
  return request({
    url: '/system/auth/editMenu',
    method: 'put',
    data: data
  })
}
// 新增菜单
export function addMenu(data:any) {
  return request({
    url: '/system/lkCategory/add',
    method: 'post',
    data: data
  })
}
// 查询菜单详细
export function getCategory(menuId:any) {
  return request({
    url: '/system/lkCategory/info/?id=' + menuId,
    method: 'get'
  })
}
// 删除菜单
export function delMenu(menuId:any) {
  return request({
    url: '/system/auth/deleteMenu',
    method: 'delete',
    data:{ids:[menuId]}
  })
}